package com.gosophia.commons.exception;

import java.io.Serializable;

import javax.xml.ws.WebFault;

/**
 * 业务异常基类，所有的业务异常都继承此类
 * */
@WebFault(name = "BusinessException", faultBean = "BusinessFaultBeanTest", targetNamespace = CustomerExceptionInfo.EXCEPTION_NAMESPACE)
public class BusinessException extends Exception implements  Serializable {
	private static final long serialVersionUID = -1723699638183184805L;
	protected ExceptionDetail faultInfo;

	public BusinessException(String message, ExceptionDetail faultInfo) {
		super(message);
		this.faultInfo = faultInfo;
	}
	
	public BusinessException(String message, String errorCode) {
        super(message);
        this.faultInfo = new ExceptionDetail(errorCode, message);
    }
	public BusinessException(String message, String errorCode,String[] values) {
        super(message);
        this.faultInfo = new ExceptionDetail(errorCode, message,values);
    }

	public BusinessException(String message, ExceptionDetail faultInfo, Throwable cause) {
		super(message, cause);
		this.faultInfo = faultInfo;
	}

	public ExceptionDetail getFaultInfo() {
		return faultInfo;
	}
 
    

}
